﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/MedicalDirector/MasterDirect.master" AutoEventWireup="true" CodeFile="Phongbenh.aspx.cs" Inherits="Management_MedicalDirector_Phongbenh" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:SqlDataSource ID="nhacungcap" runat="server" ConnectionString="<%$ ConnectionStrings:HOSPITALMANAGEMENTConnectionString %>" DeleteCommand="DELETE FROM [tbSupplier] WHERE [ID] = @ID" InsertCommand="INSERT INTO [tbSupplier] ([Name], [Address], [Tel]) VALUES (@Name, @Address, @Tel)" SelectCommand="SELECT [ID], [Name], [Address], [Tel] FROM [tbSupplier] ORDER BY [Name]" UpdateCommand="UPDATE [tbSupplier] SET [Name] = @Name, [Address] = @Address, [Tel] = @Tel WHERE [ID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="Tel" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="Tel" Type="String" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
        <table style="width:100%;">
            <tr>
                <td clas="tdtalbe" style="text-align:center; color:red;padding-bottom:10px">
                    <asp:Label ID="lbTitle1" runat="server" Text="DANH SÁCH PHÒNG BỆNH" Font-Size="Large"></asp:Label>
                </td>
                <td style="text-align:center;color:green">
                    <asp:Label ID="lbTilte2" runat="server" Text="THÔNG TIN PHÒNG BỆNH" 
                        Font-Size="Large"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 430px">
                    <asp:Panel ID="Panel1" runat="server" Width="350px" Height="320px" ScrollBars="Vertical" 
                        Style="overflow: scroll">
                    <asp:GridView ID="phongbenh" runat="server" AutoGenerateColumns="False" 
                            DataKeyNames="ID" DataSourceID="SqlDataSource1" Width="100%" 
                            OnSelectedIndexChanged="GridView1_SelectedIndexChanged" CellPadding="4" 
                            AllowSorting="True" HorizontalAlign="Center" BackColor="White" 
                            BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px">
                        <Columns>
                            
                            <asp:BoundField DataField="IDWard" HeaderText="IDWard" SortExpression="IDWard">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:BoundField>
                            <asp:BoundField DataField="RoomName" HeaderText="RoomName" SortExpression="RoomName">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:BoundField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" OnClick="phongbenh_click"
                                            CommandArgument='<%# Eval("ID") %>'> Xem</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                        <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                        <RowStyle BackColor="White" ForeColor="#330099" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                        <sortedascendingcellstyle backcolor="#FEFCEB" />
                        <sortedascendingheaderstyle backcolor="#AF0101" />
                        <sorteddescendingcellstyle backcolor="#F6F0C0" />
                        <sorteddescendingheaderstyle backcolor="#7E0000" />
                    </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:HOSPITALMANAGEMENTConnectionString %>" 
                            SelectCommand="SELECT * FROM [tbRoom]"></asp:SqlDataSource>
                        <table style="width:100%;">
                            <tr>
                                <td>&nbsp;</td>
                                <td>
                                    <asp:Button ID="Button1" runat="server" style="margin-left: 165px" Text="New" OnClick="addnew_click"/>
                                </td>
                                <td>&nbsp;</td>
                            </tr>

                        </table>
                        </asp:Panel>
                </td>
                <td style="vertical-align:top">
                            <table style="width: 87%">
                               <tr>
                                  <td colspan="2" style="color: #FF0000">
                                            &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>&nbsp;&nbsp; IDWard:</td>
                                    <td>
                                        <asp:DropDownList ID="ddlIDWard" runat="server" AutoPostBack="True" 
                                            DataSourceID="SqlDataSource2" DataTextField="ID" DataValueField="ID" 
                                            onselectedindexchanged="ddlIDWard_SelectedIndexChanged">
                                            <asp:ListItem Selected="True">1</asp:ListItem>
                                            <asp:ListItem>2</asp:ListItem>
                                            <asp:ListItem>3</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                            ConnectionString="<%$ ConnectionStrings:HOSPITALMANAGEMENTConnectionString %>" 
                                            SelectCommand="SELECT [ID] FROM [tbWard]"></asp:SqlDataSource>
                                    </td>
                                </tr>
                                <tr>
                                    <td>&nbsp;&nbsp; RoomName:</td>
                                    <td>
                                        <asp:TextBox ID="txtRoomname" runat="server" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                         &nbsp;&nbsp; Location:</td>
                                    <td>
                                        <asp:TextBox ID="txtlocation" runat="server" Width="200px" Enabled="False"></asp:TextBox>
                                    </td>
                                </tr>
                                   
                                <tr>
                                    <td>
                                        &nbsp;&nbsp; Ward:</td>
                                    <td>
                                        <asp:TextBox ID="txtward" runat="server" Width="200px" Enabled="False"></asp:TextBox>
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td>
                                        <span lang="FR">&nbsp;&nbsp; TelExt:</span></td>
                                    <td>
                                        <asp:TextBox ID="txtTel" runat="server" Width="200px" Enabled="False"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                                
                            <asp:Button ID="update" runat="server" Enabled="False" 
                        Text="Cập nhật" onclick="update_Click" />
                </td>
            </tr>
        </table>
    </asp:Content>

